
/*
 * client.c
 *
 *  Created on: 2011-12-16
 *      Author: shenjiong
 */


#undef  _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 64

#include <stdio.h>
#include <stdlib.h>

#include <time.h>
#include <math.h>

#include <curl/curl.h>
#include <openssl/ssl.h>
#include <openssl/hmac.h>
#include <openssl/md5.h>


int main()
{
    curl_global_init(CURL_GLOBAL_ALL);
    CURL * m_curl = curl_easy_init();
    struct curl_slist * m_headers = NULL;
    char buff[1024] ={0};

    sprintf(buff, "accountType=HOSTED_OR_GOOGLE&Email=%s&Passwd=%s&service=writely", "ppmsn2005@gmail.com", "asd123qwe!@#");
    printf("%s\n", buff);
    m_headers = curl_slist_append(m_headers, "Transfer-Encoding:");
    m_headers = curl_slist_append(m_headers, "Expect:");

    curl_easy_setopt(m_curl, CURLOPT_URL, "https://www.google.com/accounts/ClientLogin");

    curl_easy_setopt(m_curl, CURLOPT_POSTFIELDS, buff);
    curl_easy_setopt(m_curl, CURLOPT_HTTPHEADER, m_headers);
    curl_easy_setopt(m_curl, CURLOPT_PROXY, "127.0.0.1:1080");
    //curl_easy_setopt(easy_handle, CURLOPT_PROXYUSERPWD, "user:password");
    curl_easy_setopt(m_curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
    printf("%d\n",  curl_easy_perform(m_curl));
    return 0;
}


